using System;
using System.Collections.Generic;
using System.Text;
using Dapper.Contrib.Extensions;
using Publicuse.Entity.AttributeUtil;
using SqlSugar;

namespace Publicuse.Entity
{
  /// <summary>
  /// 登录用户信息
  /// </summary>
  [DBTable("`geeker-signininfo`", "登录用户信息")]
  [Table("`geeker-signininfo`")]
  [SugarTable("`geeker-signininfo`")]
  public class SigninInfo : BaseModel<long>
  {
    [Remark("用户编号")]
    [NoQuery]
    public int uId { get; set; } = -1;

    [Remark("登录账户")]
    public string logincode { get; set; }

    [Remark("退出系统时间")]
    public string loginouttime { get; set; }

    [Remark("IP地址")]
    public string ipaddress { get; set; }

    [Remark("IPv4地址")]
    public string ipv4address { get; set; }

    [Remark("MAC地址")]
    public string lmacaddress { get; set; }

    [Remark("操作系统名称")]
    public string osystem { get; set; }

    [Remark("操作系统类型")]
    public string osystemtype { get; set; }

    [Remark("登录会话标识")]
    public string loginid { get; set; }

    [Remark("在线时间")]
    public string onlinetime { get; set; }

    [Remark("浏览器")]
    public string browser { get; set; } = string.Empty;

    [SugarColumn(IsIgnore = true)]
    public new string createuser { get; set; }

    [SugarColumn(IsIgnore = true)]
    public new string modifyuser { get; set; }

    public SigninInfo()
    {
      this.Id = 0;
    }
  }

  /// <summary>
  /// 登录用户信息查询参数
  /// </summary>
  public class SigninInfoQuery : CommonQuery
  {
    public string logincode { get; set; }

    public string ipv4address { get; set; }

    public string ipaddress { get; set; }

    public string lmacaddress { get; set; }

    public string osystem { get; set; }

    public string osystemtype { get; set; }

    public string logintime { get; set; }

    public string loginouttime { get; set; }

    public SigninInfoQuery()
    {
      this.exportName = GetExportName;
    }

    public static string GetExportName
    {
      get { return "signinInfo"; }
    }
  }
}
